Framework / Layouts / Wrap Flow Layout
In This Topic
    Wrap Flow Layout
    In This Topic

    The wrap flow layout is represented by the NWrapFlowLayout class. The wrap flow layout places the boxes one after the other, until the boxes can fit in the arrange area - then it starts a new lane (i.e. wraps the boxes).

     Direction

    The wrap flow layout is a directed box layout, which places the cells in lanes, which flow in the current layout direction. The layout direction is controlled by the Direction property, which takes values from the ENHVDirection enumeration:

    ENHVDirection Description
    TopToBottom The layout is directed vertically, starting from the top and expanding downwards.
    BottomToTop The layout is directed vertically, starting from the bottom and expanding upwards.
    LeftToRight The layout is directed horizontally, starting from the left and expanding to the right.
    RightToLeft The layout is directed horizontally, starting from the right and expanding to the left.

    Additionally, the Inverted property specifies whether the lanes are layouted from the first to the last (the default) or from the last to the first (inverted). By default this property is set to false.

     Spacing
    Depending on the layout direction the layout uses the HorizontalSpacing and VerticalSpacing to determine the minimal spacing between the boxes and the spacing between the lanes. For a left-to-right direction the horizontal spacing is the minimal horizontal spacing between the boxes, while lanes are spaced with the specified vertical spacing.
     Filling and Fitting

    The wrap flow layout is constrained by the size of the layout area.

    Each lane of cells generated by the layout can be treated as a stack that has the orientation of the layout flow direction, and is hence a subject to stack arrangement. 
    Because the lane is never large enough to be fitted (e.g. the wrap flow layout goes to a new lane when that happens), it only makes sense to instruct the layout to fill the lanes. This is controlled by the LaneFillMode property.

    The lanes themselves can also be treated as a stack that flows in the counter orientation of the layout flow direction, and are hence subject to stack arrangement too. The FillMode and FitMode properties control the way in which the lanes fill/fit the currently available area.

    See Also